package org.idea.spring.aop.version2.interceptor;

import java.lang.reflect.Method;

/**
 * @Author linhao
 * @Date created in 10:37 上午 2021/5/16
 */
public class AfterMethodInterceptor implements IMethodInterceptor {

    private Object proxy;

    private Method method;

    public AfterMethodInterceptor(Object proxy, Method method) {
        this.proxy = proxy;
        this.method = method;
    }

    @Override
    public Object intercept(Object[] arguments) {
        try {
            return method.invoke(proxy,arguments);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
